package d2_interface2;

public class Test {
    public static void main(String[] args) {
        Driver s = new A();
        s.driver();
        Driver d = new B();
        d.driver();
    }
}

class A extends Student implements Driver, Singer{//让类更加灵活
    @Override
    public void driver(){}
    @Override
    public void singer(){}
}

class B implements Driver{
    @Override
    public void driver(){}//程序员可以针对不同类写不同的driver方法
}

class Student{ }

interface Driver{
    void driver();
}

interface Singer{
    void singer();
}